import Http from '@/http';

export function listApi() {
    return Http.get('/dictionary/category/items')
}

export function saveCategoryApi(params:any) {
    return params.id ? Http.put('dictionary/category/update/' + params.id, params) : Http.post('dictionary/category/add', params)
}
export function deleteCategoryApi(id) {
    return Http.delete('dictionary/category/delete/' + id)
}


export function saveItemApi(params:any) {
    return params.id ? Http.put('dictionary/item/update/' + params.id, params) : Http.post('dictionary/item/add', params)
}
export function deleteItemApi(id) {
    return Http.delete('dictionary/item/delete/' + id)
}


export function dictionaryItemByCategoryApi(category:string) {
    return Http.get('dictionary/item/' + category)
}